package aures.ui;

import org.gnome.gtk.TextBuffer;
import org.gnome.gtk.TextTag;
import org.gnome.gtk.TextView;
import org.gnome.pango.Font;

public class AuresStdio extends AuresPage{

	final TextView output;
	
	public AuresStdio(String src, String root, String title) throws Exception {
		super(src, root, title);
		
		this.output = (TextView) this.getWidget("txtviewServOut");
		TextBuffer buffer = new TextBuffer();
		this.output.setBuffer(buffer);
	}
	
	public void print (String text){
		TextBuffer buf = output.getBuffer();
		
		TextTag blue = new TextTag();
		blue.setForeground("blue");

		buf.insert(buf.getIterEnd(), text, blue);
	}
	
	public void printError (String error){
		TextBuffer buf = output.getBuffer();
		
		TextTag red = new TextTag();
		red.setForeground("red");

		buf.insert(buf.getIterEnd(), error, red);
	}

}
